import os, os.path

class ViewBase(object):
    context = {}
    template_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../templates'))

    def get_template(self, file):
        return os.path.abspath(os.path.join(self.template_path, file))

    def esscaped(self, attr):
        return attr.replace("&", "&amp;").replace("<", "&lt;").replace("\"", "&quot;").replace(">", "&gt;")